-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(react-query): add cli error handling #1388
Conversation
People can be co-author:
|
🦋 Changeset detectedLatest commit: 6b7f53f The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Size Change: 0 B Total Size: 69 kB ℹ️ View Unchanged
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1388 +/- ##
==========================================
- Coverage 75.81% 75.63% -0.19%
==========================================
Files 69 70 +1
Lines 583 591 +8
Branches 128 129 +1
==========================================
+ Hits 442 447 +5
- Misses 130 132 +2
- Partials 11 12 +1
|
export const logger = { | ||
log: (message: string) => console.log(LOG_PREFIX, message), | ||
error: (message: string) => console.error(LOG_PREFIX, message), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All CLI logs are handled through the logger
try { | ||
program.parse(process.argv) | ||
} catch (error) { | ||
if (error instanceof Error) { | ||
logger.error(error.message) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All throw Errors occurring during the CLI process are handled by the designated error boundary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! 👍
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @suspensive/[email protected] ### Patch Changes - [#1388](#1388) [`a9bff19`](a9bff19) Thanks [@gwansikk](https://github.com/gwansikk)! - feat(react-query): add cli error handling - Updated dependencies \[]: - @suspensive/[email protected] - @suspensive/[email protected] - @suspensive/[email protected] ## @suspensive/[email protected] ### Patch Changes - Updated dependencies \[]: - @suspensive/[email protected] ## @suspensive/[email protected] ### Patch Changes - Updated dependencies \[]: - @suspensive/[email protected] ## @suspensive/[email protected] ## @suspensive/[email protected]
Overview
related: #1383 (comment)
ref: https://github.com/tj/commander.js?tab=readme-ov-file#override-exit-and-output-handling
PR Checklist